/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.openbrew.openbrewrf;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "VesselCleaningHistory")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "VesselCleaningHistory.findAll", query = "SELECT v FROM VesselCleaningHistory v"),
    @NamedQuery(name = "VesselCleaningHistory.findByVcid", query = "SELECT v FROM VesselCleaningHistory v WHERE v.vcid = :vcid"),
    @NamedQuery(name = "VesselCleaningHistory.findByVCDate", query = "SELECT v FROM VesselCleaningHistory v WHERE v.vCDate = :vCDate")})
public class VesselCleaningHistory implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "VCID")
    private Integer vcid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "VCDate")
    @Temporal(TemporalType.DATE)
    private Date vCDate;
    @JoinColumn(name = "VCEmpID", referencedColumnName = "EmpID")
    @ManyToOne(optional = false)
    private Employee vCEmpID;
    @JoinColumn(name = "VCVesselID", referencedColumnName = "FVID")
    @ManyToOne(optional = false)
    private Fv vCVesselID;
    @JoinColumn(name = "VCProcedureID", referencedColumnName = "VCPID")
    @ManyToOne(optional = false)
    private VesselCleaningProcedure vCProcedureID;

    public VesselCleaningHistory() {
    }

    public VesselCleaningHistory(Integer vcid) {
        this.vcid = vcid;
    }

    public VesselCleaningHistory(Integer vcid, Date vCDate) {
        this.vcid = vcid;
        this.vCDate = vCDate;
    }

    public Integer getVcid() {
        return vcid;
    }

    public void setVcid(Integer vcid) {
        this.vcid = vcid;
    }

    public Fv getVCVesselID() {
        return vCVesselID;
    }

    public void setVCVesselID(Fv vCVesselID) {
        this.vCVesselID = vCVesselID;
    }

    public VesselCleaningProcedure getVCProcedureID() {
        return vCProcedureID;
    }

    public void setVCProcedureID(VesselCleaningProcedure vCProcedureID) {
        this.vCProcedureID = vCProcedureID;
    }

    public Date getVCDate() {
        return vCDate;
    }

    public void setVCDate(Date vCDate) {
        this.vCDate = vCDate;
    }

    public Employee getVCEmpID() {
        return vCEmpID;
    }

    public void setVCEmpID(Employee vCEmpID) {
        this.vCEmpID = vCEmpID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (vcid != null ? vcid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof VesselCleaningHistory)) {
            return false;
        }
        VesselCleaningHistory other = (VesselCleaningHistory) object;
        if ((this.vcid == null && other.vcid != null) || (this.vcid != null && !this.vcid.equals(other.vcid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.VesselCleaningHistory[ vcid=" + vcid + " ]";
    }
    
}
